//获取合约实例
let Web3 = require('web3')
let web3 = new Web3()
web3.setProvider('HTTP://127.0.0.1:7545');
console.log(web3.currentProvider)
let {bytecode, interface} = require('./compile')
let contractAddress = '0x00e5730ca488A3d5a1765Bb83c4B1cdA72dEC3dD'
console.log(interface)
console.log("得到的实例的合约的地址:",contractAddress)
//1.根据api和address得到合约实例
let contracInstance = new web3.eth.Contract(JSON.parse(interface), contractAddress)
console.log('得到合约实例的地址', contracInstance)
//2.返回这个合约实例
module.exports =contracInstance